import {
  Create,
  DelById,
  Update,
  GetList,
  GetEditById,
  CustomApi,
} from "./baseApi";

/**
#region 
*/
export const GetFoodCouponList = (params) =>
  GetList("corecmsfoodcoupon", params);

// 删除
export const DelFoodCouponById = (id) => DelById("corecmsfoodcoupon", id);

// 新增
export const AddFoodCoupon = (params) => Create("corecmsfoodcoupon", params);

// 获取单条
export const GetFoodCouponById = (id) => GetEditById("corecmsfoodcoupon", id);

// 编辑
export const EditFoodCoupon = (params) => Update("corecmsfoodcoupon", params);

/**
#region 
*/
export const GetFoodCouponUserList = (params) =>
  GetList("CoreCmsFoodCouponUser", params);

export const FoodCouponUserDoStop = (id) =>
  CustomApi("CoreCmsFoodCouponUser", "DoStop", { id });

export const genCouponCode = () =>
  CustomApi("CoreCmsFoodCouponUser", "GetCreate");

export const AddFoodCouponUser = (params) =>
  Create("CoreCmsFoodCouponUser", params);

export const DelFoodCouponUserById = (id) =>
  DelById("CoreCmsFoodCouponUser", id);

export const EditFoodCouponUser = (params) =>
  Update("CoreCmsFoodCouponUser", params);

export const BatchCreateCouponUser = (params) =>
  CustomApi("CoreCmsFoodCouponUser", "DoCreateBatch", params);
export const GetFoodCouponUserById = (id) =>
  GetEditById("CoreCmsFoodCouponUser", id);

/**
#region 
*/
export const GetDiscountRulesList = (params) =>
  GetList("CoreCmsDiscountRules", params);

export const DelDiscountRulesById = (id) => DelById("CoreCmsDiscountRules", id);

export const AddDiscountRules = (params) =>
  Create("CoreCmsDiscountRules", params);

export const GetDiscountRulesById = (id) =>
  GetEditById("CoreCmsDiscountRules", id);

export const EditDiscountRules = (params) =>
  Update("CoreCmsDiscountRules", params);

export const examineDiscountRules = (params) =>
  CustomApi("CoreCmsDiscountRules", "Approved", params);

export const stopDiscountRules = (params) =>
  CustomApi("CoreCmsDiscountRules", "StopUse", params);
